// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.erosion.obj;

import zombie.erosion.ErosionMain;
import zombie.iso.sprite.IsoSprite;
import zombie.iso.sprite.IsoSpriteInstance;

public final class ErosionObjOverlaySprites {
    public String name;
    public int stages;
    private ErosionObjOverlaySprites.Stage[] sprites;

    public ErosionObjOverlaySprites(int _stages, String _name) {
        this.name = _name;
        this.stages = _stages;
        this.sprites = new ErosionObjOverlaySprites.Stage[this.stages];

        for (int _int = 0; _int < this.stages; _int++) {
            this.sprites[_int] = new ErosionObjOverlaySprites.Stage();
        }
    }

    public IsoSprite getSprite(int _stage, int _season) {
        return this.sprites[_stage].seasons[_season].getSprite();
    }

    public IsoSpriteInstance getSpriteInstance(int _stage, int _season) {
        return this.sprites[_stage].seasons[_season].getInstance();
    }

    public void setSprite(int _stage, String _sprite, int _season) {
        this.sprites[_stage].seasons[_season] = new ErosionObjOverlaySprites.Sprite(_sprite);
    }

    private static final class Sprite {
        private final String sprite;

        public Sprite(String string) {
            this.sprite = string;
        }

        public IsoSprite getSprite() {
            return this.sprite != null ? ErosionMain.getInstance().getSpriteManager().getSprite(this.sprite) : null;
        }

        public IsoSpriteInstance getInstance() {
            return this.sprite != null ? ErosionMain.getInstance().getSpriteManager().getSprite(this.sprite).newInstance() : null;
        }
    }

    private static class Stage {
        public ErosionObjOverlaySprites.Sprite[] seasons = new ErosionObjOverlaySprites.Sprite[6];
    }
}
